import request from '@/utils/request.js'

/**
 * 手机登录接口
 * @param {*} params { phone 手机号码 password 密码 }
 * @returns promise
 */
export function loginPhone (params) {
  return request({
    url: '/login/cellphone',
    params
  })
}
/**
 * 注册
 * @param {*} params { captcha 验证码 phone password nickname }
 * @returns
 */
export function regPhone (params) {
  return request({
    url: '/register/cellphone',
    params
  })
}

/**
 * 获取验证码
 * @param {*} params { phone }
 * @returns
 */
export function codePhone (params) {
  return request({
    url: '/captcha/sent',
    params
  })
}

/**
 * 检测手机号码是否重复注册
 * @param {*} params { phone  }
 * @returns
 */
export function phoneRepeat (params) {
  return request({
    url: '/cellphone/existence/check',
    params
  })
}
